#!/bin/bash


#array=("b17" "dsp" "DMA_fast" "b18" "des_perf_fast")
# array=("b17" "dsp" "DMA_fast" "b18" "b22" "des_perf_fast")
# bench_dir="/home/lmin/hybrid-sta/Bench/"

# for sid in {8..15}
# do
# pids=
# for var in ${array[@]}
# do
#     echo "running $var"
#     log_name="LOGs/log_result_"$var
#     echo "log name is $log_name"
#     bench_name=$bench_dir$var\/$var".bench"
#     if [ "$var" != "b22" ]
#     then
#         ./DP $bench_name 0 $sid >> $log_name &
#     else
#         ./DP $bench_name -1 $sid >> $log_name &
#     fi
#     pids="$pids $!"
# done
# wait $pids
# echo "loop done!"
# done


rm -rf LOGs/log_result_new_*

# array=("b17" "DMA_fast")
# array=("b17" "dsp" "DMA_fast" "b18" "des_perf_fast" "b22")
array=("b17" "dsp" "DMA_fast" "b18" "b22" "des_perf_fast")
bench_dir="/home/lmin/hybrid-sta/Bench/"
for sid in {2..4}
do
pids=
for var in ${array[@]}
do
    echo "running $var"
    log_name="LOGs/log_result_new_"$var
    echo "log name is $log_name"
    bench_name=$bench_dir$var\/$var".bench"
    
    if [ "$var" == "b17" ]
    then
        ./DP $bench_name 0 $sid 0.42 >> $log_name 
    elif [ "$var" == "b18" ]
    then
        ./DP $bench_name 0 $sid 0.7 >> $log_name 
    elif [ "$var" == "b22" ]
    then
        ./DP $bench_name -1 $sid 0.32 >> $log_name 
    elif [ "$var" == "DMA_fast" ]
    then
        ./DP $bench_name 0 $sid 0.53 >> $log_name 
    elif [ "$var" == "dsp" ]
    then
        ./DP $bench_name 0 $sid 0.31 >> $log_name 
    else 
        ./DP $bench_name 0 $sid 0.25 >> $log_name 
    fi    
    pids="$pids $!"
done
wait $pids
echo "loop done!"
done
